package com.pig4cloud.pig.iotData.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;


@Configuration
@EnableAsync
public class AsyncIotDataKgBotDevFileDetConfig {
	@Bean(name = "duorouFileDetTaskExecutor")
	public Executor fileTaskExecutor() {
		ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
		executor.setCorePoolSize(5);
		executor.setMaxPoolSize(10);
		executor.setQueueCapacity(25);
		executor.setThreadNamePrefix("FileTask-");
		executor.initialize();
		return executor;
	}

//	@Bean(name = "otherTaskExecutor")
//	public Executor otherTaskExecutor() {
//		ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//		executor.setCorePoolSize(3);
//		executor.setMaxPoolSize(6);
//		executor.setQueueCapacity(10);
//		executor.setThreadNamePrefix("OtherTask-");
//		executor.initialize();
//		return executor;
//	}
}
